package com.qzsoft.zhjd.machine.modules.stationmaintain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.qzsoft.jeemis.common.validator.group.UpdateGroup;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import java.util.Date;
/**
 * @ClassName StationMaintainEntity
 * @Description 拌和站维护保养记录
 * @author linhuawei
 * @since 2021-08-23
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("n_machine_station_maintain")
public class StationMaintainEntity {

    @NotBlank(groups = UpdateGroup.class, message = "标识不可为空")
    @TableId(type = IdType.ASSIGN_UUID)
    private String id ;

    @NotBlank(message = "所属基地不能为空！")
    @Length(max = 36, message = "所在基地不可超过{max}位")
    private String baseCode ;

    private String deptPkid;

    @NotBlank(message = "拌合楼名称不能为空！")
    @Length(max = 36, message = "拌合楼名称不可超过{max}位")
    private String stationId;

    @NotBlank(message = "机长名称不能为空！")
    @Length(max = 30, message = "机长名称不可超过{max}位")
    private String captain;

    @NotBlank(message = "机修人员不能为空！")
    @Length(max = 30, message = "机修人员不可超过{max}位")
    private String mechanic;

    @NotBlank(message = "维修内容不能为空！")
    @Length(max = 255, message = "维修内容不可超过{max}位")
    private String content;

    @NotNull(message = "维修时间不能为空！")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
    private Date maintenanceTime;

    @Length(max = 255, message = "备注不可超过{max}位")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String remark ;

    @TableLogic
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private String deleted ;

    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private long creator;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;


    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NEVER)
    private long updater;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NEVER)
    private Date updateDate;
}
